<div class="layui-tab layui-tab-card think-bg-white">
    <div class="layui-card-body">
        <div id="fileManager" lay-filter="img_select"></div>
    </div>
</div>

{block name='script'}
<script>
    layui.config({
        base: "__ROOT__/static/plugs/layui/mods/"
    });
    layui.use(['jquery', 'fileManager'], function () {
        var layer = layui.layer,
            $ = layui.jquery,
            fileManager = layui.fileManager;
            fileManager.render({
                elem: '#fileManager'
                , method: 'post'
                , id: 'fmTest'
                , btn_upload: false
                , btn_create: false
                , icon_url: '__ROOT__/static/plugs/layui/mods/fileManagerico/'
                , url: '{:url("imgLists")}'
                , thumb: {'nopic': '__ROOT__/static/theme/img/404_icon.png', 'width': 100, 'height': 100}
                , parseData: function (res) {
                    let _res = [];
                    _res.code = 0;
                    _res.data = res.images;
                    _res.count = res.count
                    return _res;
                }
                , done: function (res, curr, count) {

                }
                , page: {limit: 12,layout: ['count', 'prev', 'page', 'next', 'limit', 'refresh', 'skip']}
                , where: {}
            });
            //监听图片选择事件
            fileManager.on('pic(img_select)', function (obj) {
                var data = obj.data;
                //var index = parent.layer.getFrameIndex(window.name);
                parent.window.callbackFun && parent.window.callbackFun(obj.data);
                //parent.layer.close(index);
                layer.closeAll();
            });
    });
</script>
{/block}